/*     */ package com.lmpop.trade.ti_subscribeinfo;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_subscribeinfoInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_subscribeinfoInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  25 */     Ti_subscribeinfo ti_subscribeinfo = new Ti_subscribeinfo();
/*  26 */     ti_subscribeinfo.setSub_id(map.getString("sub_id"));
/*  27 */     ti_subscribeinfo.setUser_id(map.getString("user_id"));
/*  28 */     ti_subscribeinfo.setInfo_type(map.getString("info_type"));
/*  29 */     ti_subscribeinfo.setInfo_id(map.getString("info_id"));
/*  30 */     ti_subscribeinfo.setInfo_title(map.getString("info_title"));
/*  31 */     ti_subscribeinfo.setInfo_desc(map.getString("info_desc"));
/*  32 */     ti_subscribeinfo.setInfo_img(map.getString("info_img"));
/*  33 */     ti_subscribeinfo.setPub_date(map.getString("pub_date"));
/*  34 */     ti_subscribeinfo.setCust_name(map.getString("cust_name"));
/*  35 */     ti_subscribeinfo.setCust_id(map.getString("cust_id"));
/*  36 */     ti_subscribeinfo.setIn_date(map.getString("in_date"));
/*     */ 
/*  38 */     String result_code = "0";
/*     */     try {
/*  40 */       insert(dbmMgr, ti_subscribeinfo);
/*     */     } catch (ApplicationException e) {
/*  42 */       e.printStackTrace();
/*  43 */       result_code = "1";
/*     */     }
/*  45 */     map.setString("result_code", result_code);
/*  46 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_subscribeinfo ti_subscribeinfo)
/*     */     throws ApplicationException
/*     */   {
/*  55 */     dbmMgr.update("insertTi_subscribeinfo", ti_subscribeinfo);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  65 */     String pkid_string = map.getString("pkid");
/*  66 */     String result_code = "0";
/*     */     try {
/*  68 */       if (!pkid_string.equals("")) {
/*  69 */         String[] pkStr = pkid_string.split("\\|");
/*  70 */         for (int i = 0; i < pkStr.length; i++) {
/*  71 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  75 */       e.printStackTrace();
/*  76 */       result_code = "1";
/*     */     }
/*  78 */     map.setString("result_code", result_code);
/*  79 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  88 */     dbmMgr.update("deleteTi_subscribeinfo", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  97 */     Ti_subscribeinfo ti_subscribeinfo = new Ti_subscribeinfo();
/*  98 */     ti_subscribeinfo.setSub_id(map.getString("sub_id"));
/*  99 */     ti_subscribeinfo.setUser_id(map.getString("user_id"));
/* 100 */     ti_subscribeinfo.setInfo_type(map.getString("info_type"));
/* 101 */     ti_subscribeinfo.setInfo_id(map.getString("info_id"));
/* 102 */     ti_subscribeinfo.setInfo_title(map.getString("info_title"));
/* 103 */     ti_subscribeinfo.setInfo_desc(map.getString("info_desc"));
/* 104 */     ti_subscribeinfo.setInfo_img(map.getString("info_img"));
/* 105 */     ti_subscribeinfo.setPub_date(map.getString("pub_date"));
/* 106 */     ti_subscribeinfo.setCust_name(map.getString("cust_name"));
/* 107 */     ti_subscribeinfo.setCust_id(map.getString("cust_id"));
/* 108 */     ti_subscribeinfo.setIn_date(map.getString("in_date"));
/*     */ 
/* 110 */     String result_code = "0";
/*     */     try {
/* 112 */       update(dbmMgr, ti_subscribeinfo);
/*     */     } catch (ApplicationException e) {
/* 114 */       e.printStackTrace();
/* 115 */       result_code = "1";
/*     */     }
/* 117 */     map.setString("result_code", result_code);
/* 118 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_subscribeinfo ti_subscribeinfo)
/*     */     throws ApplicationException
/*     */   {
/* 127 */     dbmMgr.update("updateTi_subscribeinfo", ti_subscribeinfo);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 138 */     Map params = (Hashtable)obj;
/* 139 */     if (start == 0)
/* 140 */       start = 0;
/*     */     else {
/* 142 */       start = (start - 1) * limit;
/*     */     }
/* 144 */     params.put("start", Integer.valueOf(start));
/* 145 */     params.put("limit", Integer.valueOf(limit));
/*     */ 
/* 147 */     return this.queryList.getList("getListByTi_subscribeinfoPage", params);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 159 */     Map params = (Hashtable)obj;
/* 160 */     List list = this.queryList.getList("getCountByObjTi_subscribeinfo", params);
/* 161 */     int count = 0;
/* 162 */     if ((list != null) && (list.size() > 0)) {
/* 163 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 164 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 165 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 168 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 178 */     return this.queryList.getList("getTi_subscribeinfoByPk", pk);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_subscribeinfo.Ti_subscribeinfoInfo
 * JD-Core Version:    0.6.0
 */